package com.atguigu.gulimall.order.test;

import java.util.LinkedList;
import java.util.List;

public class SingleLinkedListDemo {

	public static void main(String[] args) {
		List<HeroNode> list = new LinkedList<HeroNode>();
		HeroNode heroNode = new HeroNode(1, "宋江", "lu");
		HeroNode heroNode1 = new HeroNode(2, "宋江", "lu");
		HeroNode heroNode2 = new HeroNode(3, "宋江", "lu");
		list.add(heroNode);
		list.add(heroNode2);
		list.add(heroNode1);
		for (HeroNode node : list) {
			System.out.println(node);
		}
	}

	public static void reversePrint(HeroNode head) {

	}
	

	public static void reversetList(HeroNode head) {

	}

	public static int getLength(HeroNode head) {
		return 0;
	}

}



class SingleLinkedList {

	HeroNode head = new HeroNode(0,"",""); //链表头

	/**
	 * 添加链表
	 */
	public void add(HeroNode heroNode){
		HeroNode temp = head;
		while (true){
			if (temp.next==null){
				//最后一个节点
				break;
			}
			//如果不是 后移
			temp = temp.next;
		}
	}

}


class HeroNode {
	public int no;
	private String name;
	private String nickeName;
	public HeroNode next;//指向下一个节点

	@Override
	public String toString() {
		return "HeroNode{" +
				"no=" + no +
				", name='" + name + '\'' +
				", nickeName='" + nickeName + '\'' +
				'}';
	}

	public HeroNode(int no, String name, String nickeName) {
		this.no = no;
		this.name = name;
		this.nickeName = nickeName;
	}
}
